# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=pipx
pkgver=1.5.0
pkgrel=1
pkgdesc="Install and Run Python Applications in Isolated Environments"
url="https://github.com/pypa/pipx"
arch="noarch"
license="MIT"
depends="
	py3-argcomplete
	py3-colorama
	py3-packaging
	py3-platformdirs
	py3-userpath
	"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-hatch-vcs
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/pypa/pipx/archive/refs/tags/$pkgver.tar.gz"
options="!check" # need some packages that i'm not sure of

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -p no:warnings
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
7d8d64f2b042f050153dee27a759de2734a567a445470411c2838292e9365cfa18199cb096c0015651210e656173006be0cba20a16cc4b3ebc211a6a2caef2c7  pipx-1.5.0.tar.gz
"
